/**
 * @file poj/2352/main.cpp
 * @author Ruiming Guo (guoruiming@stu.scu.edu.cn)
 * @brief
 *
 *   5
 *  4
 * 1  23
 *
 * 二维偏序，一层一层来，对``x``，先把自己加进去，再查询前缀和-1(减去自己)
 * @version 1.0
 * @date 2022-05-02
 * @see <https://poj.org/problem?id=2352>
 *
 * @copyright Copyright (c) 2022
 *
 **/

#include <bits/stdc++.h>
using namespace std;
const int N = 32005;
int n, tree[N], sum[N], stars[N], x, y;
int lowbit(int i) { return i & -i; }
void update(int i, int x) {
  while (i < N) {
    tree[i] = tree[i] + x;
    i += lowbit(i);
  }
}
int query(int n) {
  int sum = 0;
  while (n > 0) {
    sum += tree[n];
    n -= lowbit(n);
  }
  return sum;
}
int main() {
  while (~scanf("%d", &n)) {
    memset(sum, 0, sizeof(sum));
    memset(tree, 0, sizeof(tree));
    memset(stars, 0, sizeof(stars));

    for (int i = 1; i <= n; ++i) {
      scanf("%d%d", &x, &y);
      update(x + 1, 1);
      int cnt = query(x + 1) - 1;
      stars[cnt]++;
    }
    for (int i = 0; i < n; ++i) printf("%d\n", stars[i]);
  }
}
